#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define OJ_TEST 0
#define LOCAL_TEST 0

#define M 901

static int max(int a, int b){ return a>b?a:b; }
static int min(int a, int b) { return a<b?a:b; }

static void solve(void){
#if 0
	int n, nr, x;
	for(nr=1,x=2; ; ++x){
		n = x;
		while(n%2==0) n>>=1;
		while(n%3==0) n /=3;
		while(n%5==0) n/=5;
		if(n==1) ++nr;
		if(nr==1500) break;
	}
	printf("%d\n", x);
#else
	puts("The 1500'th ugly number is 859963392.");
#endif
}
#if OJ_TEST
	int main(int ac, char *av[]){
		solve();
		return 0;
	}
#elif  LOCAL_TEST
	void run(void){
		solve();
	}

#else

#endif
